#pragma once
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <stdbool.h>

#include <time.h>

typedef int HeapDataType;

typedef struct Heap
{
	HeapDataType* data;
	int size;
	int capacity;
}Heap;

void HeapInit(Heap* php);
void HeapDestroy(Heap* php);
void HeapPush(Heap* php, HeapDataType x);
void HeapPop(Heap* php);

bool HeapEmpty(Heap* php);
int HeapSize(Heap* php);
HeapDataType HeapTop(Heap* php);

void AdjustUp(HeapDataType* data, int child);
void AdjustDown(HeapDataType* data, int n, int parent);
void Swap(HeapDataType* p1, HeapDataType* p2);